package com.grsu.phonestation.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.grsu.phonestation.dao.EnrolleePaymentDAO;
import com.grsu.phonestation.domain.EnrolleePayment;
import com.grsu.phonestation.service.EnrolleePaymentService;

@Service
@Transactional
public class EnrolleePaymentServiceImpl extends PaymentServiceImpl<EnrolleePayment> implements EnrolleePaymentService {

	@Autowired
	@Qualifier("enrolleePaymentDAOImpl")
	private EnrolleePaymentDAO enrolleePaymentDAO;
		
	@Override
	public void addPayment(EnrolleePayment payment) {
		enrolleePaymentDAO.save(payment);
	}
	
	
	@Override
	public double getSumEnrolleePaymentClientForPeriod(String user,
			String beginPeriod, String endPeriod) {
		return enrolleePaymentDAO.getSumEnrolleePaymentClientForPeriod(user, beginPeriod, endPeriod);
	}

}
